<!DOCTYPE html>
<html lang="en">
  <head>
	<title>NSC Builder by JulesOnTheRoad</title>
	<link rel="icon" type="image/vnd.microsoft.icon" href="img/squirrelv2.ico" sizes="16x16 24x24 36x36 48x48">
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <!-- Metro 4 -->
    <link rel="stylesheet" href="css/metro-all.min.css">
	<style>
		::-webkit-scrollbar {
			width: 0px;  /* Remove scrollbar space */
			background: transparent;  /* Optional: just make scrollbar invisible */
		}
	</style>
    <script type="text/javascript" src="/eel.js"></script>
    <script type="text/javascript" src="https://raw.githubusercontent.com/eligrey/FileSaver.js/master/src/FileSaver.js"></script>
	<script>
		document.addEventListener("DOMContentLoaded", function() {
		eel.get_libraries()(set_local_libraries)
		eel.get_drive_libraries()(set_remote_libraries)
		});
	</script>
</head>
<body  class="bg-lightGray fg-white h-vh-100 m4-cloak">
<div class="head-bar pos-absolute bg-cobalt fg-white">
    <span class="app-title">NSC Builder 1.01 - 文件信息</span>
    <div style="margin-left:auto;margin-right:0;"><button class="expand-button light" id="collapse_toggle_2"><span></span></button></div>
	<div class="pos-absolute z-dropdown" style="margin-top:131px;left:auto;right:0;position:absolute">
		<div class="bg-lightCobalt fg-white" data-role="collapse"
			 data-toggle-element="#collapse_toggle_2" data-collapsed="true">
			 <ul data-role="listview" class="bg-lightCobalt fg-white">
				<!-- <li class="bg-cobalt-hover" onclick="close_topmenu()"><strong>1: Individual Processing Mode</strong></li> -->
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>1：单文件处理模式</strong></li>				
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>2：多文件生成模式</strong></li>	
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>3：多文件分割模式</strong></li>	
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>4：文件信息模式</strong></li>	
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>5：数据库模式</strong></li>		
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>6：高级模式</strong></li>		
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>7：文件合并模式</strong></li>	
				<li class="bg-cobalt-hover" onclick="sideviewclicks()"><strong>0：配置模式</strong></li>
		</div>
	</div>
</div>
<div><ul class="app-bar-present pos-absolute"  data-expand="false"
    data-role="materialtabs"
    data-fixed-tabs="true"
    data-deep="true"
    data-cls-tab="bg-white fg-black text-bold "
    data-cls-tab-active="text-bold fg-black"
    data-cls-marker="bg-cobalt"
>
    <li><a href="#_Information_" onclick="show_gameinfo()" style="font-size: 1.86vh" id="info_tab">信息</a></li>
    <!-- <li><a href="#"  style="font-size: 1.86vh">Description</a></li>	 -->
    <li><a href="#_Information_" onclick="show_filedata()"   style="font-size: 1.86vh">Titles</a></li>
    <li><a href="#_Information_" onclick="show_nacpdata()"   style="font-size: 1.86vh">Nacp</a></li>
    <li><a href="#_Information_" onclick="show_npdmdata()"   style="font-size: 1.86vh">Npdm</a></li>
    <li><a href="#_Information_" onclick="show_cnmtdata()"   style="font-size: 1.86vh">Cnmt</a></li>
    <li><a href="#_Information_" onclick="show_verdata()"   style="font-size: 1.86vh">校验</a></li>
</ul></div>

<div data-role="navview" data-compact="md" data-expanded="xxl" data-toggle="#pane-toggle" id="_Information_">
	<nav class="navview-pane"  style="margin-top:100px;">
		<button class="pull-button" onclick="navviewclick();" id="nav_view_but">
			<span class="mif-menu fg-black"></span>
		</button>

		<ul class="navview-menu" style="margin-top:1px;margin-bottom:1px;">

			<li class="item-header">游戏信息</li>

			<li>
				<a href="#_Information_" onclick="show_gameinfo();" id="_inf_bar_but">
					<span class="icon"><span class="mif-gamepad"></span></span>
					<span class="caption">游戏信息</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="show_description()" class="disabled" id="_desc_bar_but">
					<span class="icon"><span class="mif-leanpub fg-steel" id="_desc_bar_but1"></span></span>
					<span class="caption fg-steel" id="_desc_bar_but2">描述</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="show_pictures()" class="disabled" id="_pict_bar_but">
					<span class="icon"><span class="mif-images fg-steel" id="_pict_bar_but1"></span></span>
					<span class="caption fg-steel"  id="_pict_bar_but2">图片</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="show_video()" class="disabled" id="_video_bar_but">
					<span class="icon"><span class="mif-video-camera fg-steel" id="_video_bar_but1"></span></span>
					<span class="caption fg-steel" id="_video_bar_but2">预告片</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="show_gametree()" class="disabled" id="_gtree_bar_but">
					<span class="icon"><span class="mif-tree fg-steel" id="_gtree_bar_but1"></span></span>
					<span class="caption fg-steel" id="_gtree_bar_but2">游戏树</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="show_cheats()" class="disabled" id="_cheats_bar_but">
					<span class="icon"><span class="mif-bug fg-steel" id="_cheats_bar_but1"></span></span>
					<span class="caption fg-steel" id="_cheats_bar_but2">金手指</span>
				</a>
			</li>
			<li class="item-header" style="margin-top: 2vh">库</li>
			<li>
				<a href="#_Information_" onclick="get_local_libraries()" class="enabled" id="_library" style="margin-top: 2vh">
					<span class="icon"><span class="mif-drive2 fg-black" id="_library_bar_but1"></span></span>
					<span class="caption fg-black" id="_library_bar_but2">库</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="get_remote_libraries()" class="enabled" id="_cloudlibrary">
					<span class="icon"><span class="mif-cloud-download fg-black" id="_cloudlibrary_bar_but1"></span></span>
					<span class="caption fg-black" id="_cloudlibrary_bar_but2">云库</span>
				</a>
			</li>
			<li>
				<a href="#_Information_" onclick="start_from_link()" class="enabled" id="_link">
					<span class="icon"><span class="mif-link fg-black" id="_ link_bar_but1"></span></span>
					<span class="caption fg-black" id="_ link_bar_but2">直链</span>
				</a>
			</li>
			<li class="item-header" style="margin-top: 2vh">调试</li>
			<li>
				<a href="#_Information_" onclick="show_debug();set_debug()" class="enabled" id="_showdebug_bar_but">
					<span class="icon"><span class="mif-description fg-black" id="_ showdebug_bar_but1"></span></span>
					<span class="caption fg-black" id="_ showdebug_bar_but2">控制台日志</span>
				</a>
			</li>
		</ul>
	</nav>
	<div class="navview-content pl-4-md pr-4-md bg-lightGray" id="_Info_">
		<span></span>
		<p class="mif-menu fg-light" height='100px'></p>
		<div class="grid" style="margin-top:75px">
			<div class="row" style="height: 80vh;margin-bottom: 1px;overflow:auto;" id="_viewspace_">
				<div class="cell" style="font-size: 1.68vh;overflow-z:auto;" id="_GameInfo_"><div><div style="width: 55vw">
					<p style="margin-bottom: 2px;margin-top: 2px;font-size: 2vh"><strong>Title信息：</strong></p>
					<ul style="margin-bottom: 2px;margin-top: 3px">
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>名称： </strong><span  id="tname">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>发行商： </strong><span  id="editor">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>开发者： </strong><span  id="developer">-</span></li>					
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>类型： </strong><span  id="ctype">-</span></li>					
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>Title ID: </strong><span  id="tid">-</span></li>	
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>版本： </strong><span  id="version">-</span></li>			
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>显示版本： </strong><span  id="dispver">-</span></li>	
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>Meta SDK版本： </strong><span  id="metasdk">-</span></li>		
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>程序SDK版本： </strong><span  id="exesdk">-</span></li>		
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>语言： </strong><span  id="langue">-</span></li>						
					<!-- <li style="margin-bottom: 2px;margin-top: 3px"><strong>发行类型: </strong><span  id="disttype">-</span></li>		 -->
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>HTML手册: </strong><span  id="htmlmanual">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>关联账户: </strong><span  id="linkedacc">-</span></li>	
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>线上游戏: </strong><span  id="onlineplay">-</span></li>	
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>云储存: </strong><span  id="savedatacloud">-</span></li>						
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>内容组成： </strong><span  id="multicontent">-</span></li>						
					<li style="margin-bottom: 2px;margin-top: 3px;visibility:visible;" id="titlekey_holder"><strong>Title密钥： </strong><span  id="titlekey">-</span></li>					
					</ul>
					<p style="margin-bottom: 2px;margin-top: 5px;font-size: 2vh"><strong>所需固件： </strong></p>	
					<ul style="margin-bottom: 2px;margin-top: 3px">
					<li style="margin-bottom: 2px;margin-top: 3px;visibility:hidden;display:none;" id="firm_holder"><strong>包含的固件： </strong><span  id="firm">-</span></li>					
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>所需的系统版本： </strong><span  id="rsv">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px;visibility:hidden;display:none;" id="rgv_holder"><strong>所需的游戏版本: </strong><span  id="rgv">-</span></li>					
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>加密（密钥生成）： </strong><span  id="keygeneration">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px"><strong>可修补至： </strong><span  id="patchable">-</span></li>	
					</ul>
					<p style="margin-bottom: 2px;margin-top: 5px;font-size: 2vh;visibility:visible;" class="exefsdata"><strong>ExeFs数据： </strong></p>	
					<ul style="margin-bottom: 2px;margin-top: 3px;visibility:visible;" class="exefsdata">
					<li style="margin-bottom: 2px;margin-top: 3px;visibility:visible;" class="exefsdata"><strong>内部版本号8： </strong><span  id="buildid8">-</span></li>
					<li style="margin-bottom: 2px;margin-top: 3px;word-break: break-all;visibility:visible;" class="exefsdata"><strong>内部版本号： &nbsp;&nbsp;</strong><span  id="buildid">-</span></li>
					</ul>
			</div></div></div>

				<div class="cell" id="_Description_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="font-size: 16px; justify;text-justify: inter-word;"><i><strong id="introduction"></strong></i></p>
					<p style="font-size: 2vh;text-align: justify;text-justify: inter-word;white-space: pre-line;" id="description"></p>
			</div></div></div>

				<div class="cell" id="_Pictures_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="margin-bottom: 2px;margin-top: 2px;font-size: 2vh"><strong>图片：</strong></p>
			</div></div></div>

				<div class="cell" id="_Video_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<!-- <p style="margin-bottom: 2px;margin-top: 2px;font-size: 2vh"><strong>预告片：</strong></p>-->
					<center>
						<!-- <h1>Hls.js demo - basic usage</h1> -->
						<video height="480" id="video_container" controls></video>
					</center>
			</div></div></div>

				<div class="cell" id="_Gametree_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="font-size: 2vh;text-align: justify;text-justify: inter-word;white-space: pre-line;" id="gametree"></p>
			</div></div></div>

				<div class="cell" id="_Cheats_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="font-size: 2vh;text-align: justify;text-justify: inter-word;white-space: pre-line;" id="cheat_data"></p>
			</div></div></div>

				<div class="cell" id="_Debug_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="margin-bottom: 2px;margin-top: 2px;font-size: 2vh"><strong>控制台日志：</strong></p>
					<pre id="debug_data" style="width:90vw"></pre>
			</div></div></div>

				<div class="cell" id="_LocalLibrary_" style="font-size: 1.84vh;display:none;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="margin-bottom: 2px;margin-top: 2px;font-size: 2.4vh;position: fixed; z-index: 1;"><strong>本地库：</strong></p>
					<div class="row bg-lightGray" style="width:130vw;position: fixed; z-index: 1;">
						<div class="cell bg-lightGray"  style="width: 70vw">
							<input type="text" data-role="input" data-search-button="true" data-search-button-click="custom" data-on-search-button-click="search_local_lib" id="slocalbox" onkeyup="search_table('slocalbox','_search_results_')">
						</div>
						<div class="cell bg-lightGray" style="width:25vw" id="_local_lib_tags_">
							<select class="bg-cobalt fg-white" data-role="select" style="width:25vw" id="_local_lib_select_">
							<option value="all" selected="selected">All</option>
							</select>
						</div></div>
					<div class="row" style="width:100vw">
						<div data-role="activity" data-type="metro" data-style="dark" id="local_activity" style="margin-top:200px;visibility:hidden;display:none"></div>
					</div>
					<div class="row" style="width:100vw;display:none;overflow-z:auto;margin-top: 50px;" id="_search_results_">
					</div>
			</div></div></div>

				<div class="cell" id="_RemoteLibrary_" style="font-size: 2vh;display:none;overflow-z:auto;"><div><div style="width: 55vw;margin-left:0;margin-right:auto;">
					<p style="margin-bottom: 2px;margin-top: 2px;font-size: 2.4vh;position: fixed; z-index: 1;"><strong>云库：</strong></p>
					<div class="row  bg-lightGray" style="width:130vw;position: fixed; z-index: 1;">
						<div class="cell  bg-lightGray"  style="width: 70vw">
							<input type="text" data-role="input" data-search-button="true" data-search-button-click="custom" data-on-search-button-click="search_remote_lib" id="remotebox"  onkeyup="search_table('remotebox','_search_results2_')">
						</div>
						<div class="cell bg-lightGray" style="width:25vw" id="_remote_lib_tags_">
							<select class="bg-cobalt fg-white" data-role="select" style="width:25vw" id="_remote_lib_select_">
							<option value="all" selected="selected">All</option>
							</select>
						</div></div>
					<div class="row" style="width:100vw">
						<div data-role="activity" data-type="metro" data-style="dark" id="remote_activity" style="margin-top:200px;visibility:hidden;display:none"></div>
					</div>
					<div class="row" style="width:100vw;display:none;overflow-z:auto;margin-top: 50px;" id="_search_results2_">
					</div>
			</div></div></div>

				<div class="cell" id="_Files_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 85vw;margin-left:0;margin-right:auto;">
					<div id="_filedata_"></div>
			</div></div></div>

				<div class="cell" id="_Nacp_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 62.5vw;margin-left:0;margin-right:auto;">
					<div id="_nacpdata_"></div>
			</div></div></div>

				<div class="cell" id="_Npdm_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 62.5vw;margin-left:0;margin-right:auto;">
					<div id="_npdmdata_"></div>
			</div></div></div>

				<div class="cell" id="_Cnmt_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 85vw;margin-left:0;margin-right:auto;">
					<div id="_cnmtdata_"></div>
			</div></div></div>

				<div class="cell" id="_Verification_" style="font-size: 1.86vh;display:none;overflow-z:auto;"><div><div style="width: 65vw;margin-left:0;margin-right:auto;">
					<p style="font-size: 1.86vh;text-align: left;white-space: pre-line;"><strong><span id="_verificationdata_"></span></strong></p>
			</div></div></div>

			<div class="cell" style="height: 72vh;margin-right:1px;overflow-z:auto;" id="_imagebox_">
				<div style="position:relative;border:0;"><img src="img/placeholder.gif" style="position:relative;width:30vw;height:30vw;max-width:45vh;max-height:45vh;border:0;" class="img-container drop-shadow" id="gamepicture">
				<h6 id="ctag_overlay" class="fg-light bg-red" style="position:absolute;  bottom: 0px;margin-bottom:0px; left:0px;  width:30vw;max-width:45vh;height:4vh;
					opacity:0.80;text-align: center;visibility:hidden;font-size:3vh;"><span width="37vh";>CONTENT</span></h6></div>
				<p style="margin-bottom: 2px;margin-top: 10px;font-size: 1.68vh"><strong>nsuID: </strong><span  id="nsuid">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>产品编号： </strong><span  id="productcode">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>发行： </strong><span  id="distributiontype">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>地区： </strong><span  id="regions">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh;visibility:visible;visibility:block;" id="metascore_holder"><strong>Metacritic评分：</strong><span  id="metascore">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh;visibility:visible;visibility:block;" id="openscore_holder"><strong>Openscore评分：</strong><span  id="openscore">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh;visibility:visible;visibility:block;" id="userscore_holder"><strong>用户评分：</strong><span  id="userscore">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>发布日期：</strong><span  id="worldreleasedate">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh;visibility:hidden;display:none;" id="GamecardSize_holder"><strong>游戏卡容量：</strong><span  id="GamecardSize">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>安装大小：</strong><span  id="InstalledSize">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>年龄等级：</strong><span  id="AgeRatings">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>玩家人数：</strong><span  id="numberOfPlayers">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>游戏模式：</strong><span  id="gamemodes">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>类型：</strong><span  id="genretags">-</span></p>
				<p style="margin-bottom: 2px;margin-top: 2px;font-size: 1.68vh"><strong>评分标签：</strong><span  id="ratingtags">-</span></p>
			</div></div></div>
			<div class="row" style="margin-bottom: 2px;margin-top: 1px;height: 3vh;bottom:4vh; position:absolute;">
				<div class="cell" style='width:55vw;'></div>
				<div class="cell" style="width:35vw;">
					<button class="button alert"  style="height: 40px; width:70px;left:auto;right:-1;margin-right:0;margin-left:80%; position:absolute;" onclick="start()" id="load_button">
					<span class="caption">加载</span></button></div>
			</div>
	</div>
</div>

<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/metro.min.js"></script>
<script src="js/hls.js"></script>
<script>
navclicks=0;
sideclicks=0;
H=screen.height;W=screen.width;
function navviewclick(){
if (navclicks>0){navclicks=0}
else{navclicks = navclicks+1;}
<!-- console.log(navclicks); -->
}
function sideviewclicks(){
document.getElementById("collapse_toggle_2").click();
}

async function start(){
	show_gameinfo()
	var fname=await eel.getfname()();
	if (fname!=null && fname!=""){
		<!-- console.log(fname); -->
		resetInfo()
		start2(fname)
	}
}

async function start_from_link(){
	var fname = prompt("Enter local path, gdrive path or public link",
					"");
	<!-- console.log(fname) -->
	if (fname!=null && fname!=""){
		show_gameinfo()
		resetInfo()
		eel.addtodrive(fname)(start2_remote)
	}
}

async function start_from_library(data){
	fname=data.innerHTML
	<!-- console.log(fname) -->
	if (fname!=null && fname!=""){
		show_gameinfo()
		resetInfo()
		start2(fname)
	}
}

async function start_from_remote_library(data){
	fname=data.innerHTML
	<!-- console.log(fname) -->
	if (fname!=null && fname!=""){
		show_gameinfo()
		resetInfo()
		start2_remote(fname)
	}
}

async function start2(fname){
	eel.call_showicon(fname)
	eel.call_getinfo(fname)
	eel.call_get_adv_filelist(fname)
	eel.call_get_nacp_data(fname)
	eel.call_get_npdm_data(fname)
	eel.call_get_cnmt_data(fname)
	eel.call_get_verification_data(fname)
}

function onStartedDownload(id) {
  console.log(`Started downloading: ${id}`);
}

function onFailed(error) {
  console.log(`Download failed: ${error}`);
}

<!-- eel.expose(browser_download); -->
<!-- function browser_download(url,token) { -->
<!-- var xhr = new XMLHttpRequest(); -->
<!-- xhr.open("GET", url, true); -->
<!-- xhr.setRequestHeader('Authorization','Bearer '+token); -->
<!-- xhr.responseType = 'arraybuffer' -->
<!-- xhr.send(); -->
<!-- } -->



eel.expose(browser_download);
function browser_download(url,token){
	console.log(url)
	console.log(token)
    var xhr = new XMLHttpRequest();
	xhr.onload = function () {
		console.log(this.status)
		if (this.status!=404){
			var blob = xhr.response;
			downloadFile(blob);
		}
	}
	xhr.open('GET', url, true);
	xhr.setRequestHeader('Authorization','Bearer '+token);
	xhr.responseType = 'blob';
	<!-- xhr.responseType = 'arraybuffer';	 -->
	xhr.send();
}

function downloadFile(blob)
{
	console.log(blob)
    var a = document.createElement("a");
    document.body.appendChild(a);
    a.style = "display: none";

    var url = window.URL.createObjectURL(blob);
    a.href = url;
    a.download = 'test.nsp';
    a.click();
    window.URL.revokeObjectURL(url);
}







async function start2_remote(fname){
	console.log(fname)
	eel.call_showicon_remote(fname)
	eel.call_getinfo(fname,"True")
	eel.call_get_adv_filelist(fname,"True")
	eel.call_get_nacp_data(fname,"True")
	eel.call_get_npdm_data(fname,"True")
	eel.call_get_cnmt_data(fname,"True")
	<!-- eel.download(fname,"True")		 -->
	<!-- get_verification_data_remote(fname) -->
}

eel.expose(setImage);
function setImage(base64) {
	<!-- console.log(base64) -->
	document.getElementById("gamepicture").src = base64
	if (base64!=''){document.getElementById("gamepicture").src = base64}
	else{document.getElementById("gamepicture").src = "img/placeholder.gif"}
}

eel.expose(set_adv_filelist);
function set_adv_filelist(data) {
	document.getElementById("_filedata_").innerHTML = data;
}

eel.expose(set_nacp_data);
function set_nacp_data(data) {
	document.getElementById("_nacpdata_").innerHTML = data;
}

eel.expose(set_npdm_data);
function set_npdm_data(data) {
	document.getElementById("_npdmdata_").innerHTML = data;
}

eel.expose(set_cnmt_data);
function set_cnmt_data(data) {
	document.getElementById("_cnmtdata_").innerHTML = data;
}

eel.expose(set_ver_data);
function set_ver_data(data) {
	document.getElementById("_verificationdata_").innerHTML = data;
}

eel.expose(setInfo);
function setInfo(data) {
	document.getElementById("tname").innerHTML = data[0];
	document.getElementById("editor").innerHTML = data[1];
	document.getElementById("tid").innerHTML = data[2];
	document.getElementById("version").innerHTML = data[3];
	document.getElementById("ctype").innerHTML = data[4];
	document.getElementById("dispver").innerHTML = data[5];
	document.getElementById("metasdk").innerHTML = data[6];
	document.getElementById("exesdk").innerHTML = data[7];
	document.getElementById("langue").innerHTML = data[8];
	document.getElementById("rsv").innerHTML = data[9];
	document.getElementById("keygeneration").innerHTML = data[10];
	<!-- document.getElementById("PATCHABLE").innerHTML = data[9]; -->
	document.getElementById("nsuid").innerHTML = data[11];
	document.getElementById("genretags").innerHTML = data[12];
	document.getElementById("ratingtags").innerHTML = data[13];
	document.getElementById("worldreleasedate").innerHTML = data[14];
	document.getElementById("numberOfPlayers").innerHTML = data[15];
	document.getElementById("AgeRatings").innerHTML = data[16];
	document.getElementById("InstalledSize").innerHTML = data[17];
	document.getElementById("buildid8").innerHTML = data[18];
	document.getElementById("buildid").innerHTML = data[19];
	document.getElementById("titlekey").innerHTML = data[20];
	if (data[20] == "-"){
	document.getElementById("titlekey_holder").style.visibility = 'hidden';
	document.getElementById("titlekey_holder").style.display = "none";
	}
	document.getElementById("patchable").innerHTML = data[21];
	document.getElementById("regions").innerHTML = data[22];
	document.getElementById("introduction").innerHTML = data[23];
	document.getElementById("description").innerHTML = data[24];
	document.getElementById("htmlmanual").innerHTML = data[25];
	document.getElementById("linkedacc").innerHTML = data[26];
	document.getElementById("multicontent").innerHTML = data[27];
	document.getElementById("distributiontype").innerHTML = data[28];
	document.getElementById("developer").innerHTML = data[32];
	document.getElementById("productcode").innerHTML = data[33];
	document.getElementById("onlineplay").innerHTML = data[34];
	document.getElementById("savedatacloud").innerHTML = data[35];
	document.getElementById("gamemodes").innerHTML = data[36];
	document.getElementById("metascore").innerHTML = data[37];
	document.getElementById("userscore").innerHTML = data[38];
	document.getElementById("openscore").innerHTML = data[41];
	if (data[37] == "-"){
	document.getElementById("metascore_holder").style.display = "none";
	}
	if (data[38] == "-"){
	document.getElementById("userscore_holder").style.display = "none";
	}
	if (data[41] == "-"){
	document.getElementById("openscore_holder").style.display = "none";
	}

	document.getElementById("GamecardSize").innerHTML = data[29];
	if (data[29]!== "-"){
	document.getElementById("GamecardSize_holder").style.visibility = 'visible';
	document.getElementById("GamecardSize_holder").style.display = "block";
	}
	document.getElementById("_Pictures_").innerHTML = data[30];
	document.getElementById("_desc_bar_but").setAttribute("class", "enabled");
	document.getElementById("_desc_bar_but1").setAttribute("class", "mif-leanpub fg-black");
	document.getElementById("_desc_bar_but2").setAttribute("class", "caption fg-black");
	document.getElementById("_pict_bar_but").setAttribute("class", "enabled");
	document.getElementById("_pict_bar_but1").setAttribute("class", "mif-images fg-black");
	document.getElementById("_pict_bar_but2").setAttribute("class", "caption fg-black");
	document.getElementById("ctag_overlay").innerHTML = data[4];
	if (data[4]!== "GAME" && data[4]!== undefined){
	document.getElementById("ctag_overlay").style.visibility = 'visible';
	}
	if (data[4] == "DLC"){
    var dataToHide = document.getElementsByClassName("exefsdata");
    for(var i = 0; i < dataToHide.length; i++){
        dataToHide[i].style.visibility = "hidden";}
	document.getElementById("rgv").innerHTML = data[31];
	document.getElementById("rgv_holder").style.visibility = 'visible';
	document.getElementById("rgv_holder").style.display = "list-item";
	}
	if (data[39] !== "-"){
	document.getElementById("firm").innerHTML = data[39];
	document.getElementById("firm_holder").style.visibility = 'visible';
	document.getElementById("firm_holder").style.display = "list-item";
	}
	eel.getfiletree(data[2])(set_filetree)
	eel.getcheats(data[2])(set_cheats)
	if (data[40]!== "-"){
		set_video(data[40])
	}
}

function set_filetree(data) {
	document.getElementById("gametree").innerHTML = data;
	document.getElementById("_gtree_bar_but").setAttribute("class", "enabled");
	document.getElementById("_gtree_bar_but1").setAttribute("class", "mif-tree fg-black");
	document.getElementById("_gtree_bar_but2").setAttribute("class", "caption fg-black");
}

function set_cheats(data) {
	document.getElementById("cheat_data").innerHTML = data;
	document.getElementById("_cheats_bar_but").setAttribute("class", "enabled");
	document.getElementById("_cheats_bar_but1").setAttribute("class", "mif-bug fg-black");
	document.getElementById("_cheats_bar_but2").setAttribute("class", "caption fg-black");
}

function set_debug() {
	var str = window.location.href;
	var res = str.split(":");var str =res[2]
	var res = str.split("/");var port =res[0]
	var tlog='_debug_/log_'+port+'.txt'
	<!-- console.log(tlog); -->
    var xhr = new XMLHttpRequest();
    xhr.onload = function () {
		document.getElementById("debug_data").textContent = this.responseText;
    };
    xhr.open('GET', tlog);
    xhr.send();
}

function set_video(data) {
	if(Hls.isSupported()) {
	  var video = document.getElementById('video_container');
	  var hls = new Hls();
  	  hls.loadSource(data);
	  hls.attachMedia(video);
   }
   // hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
   // When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
   // This is using the built-in support of the plain video element, without using hls.js.
	else if (video.canPlayType('application/vnd.apple.mpegurl')) {
	  video.src = data
	}
	document.getElementById("_video_bar_but").setAttribute("class", "enabled");
	document.getElementById("_video_bar_but1").setAttribute("class", "mif-video-camera fg-black");
	document.getElementById("_video_bar_but2").setAttribute("class", "caption fg-black");
}

function resetInfo() {
	eel.clear()
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_GameInfo_").style.display = "block";
	document.getElementById("gamepicture").src = "img/placeholder.gif"
	document.getElementById("tname").innerHTML = '-';
	document.getElementById("editor").innerHTML = '-';
	document.getElementById("tid").innerHTML = '-';
	document.getElementById("version").innerHTML = '-';
	document.getElementById("ctype").innerHTML = '-';
	document.getElementById("dispver").innerHTML = '-';
	document.getElementById("metasdk").innerHTML = '-';
	document.getElementById("exesdk").innerHTML = '-';
	document.getElementById("langue").innerHTML = '-';
	document.getElementById("rsv").innerHTML = '-';
	document.getElementById("firm").innerHTML = '-';
	document.getElementById("keygeneration").innerHTML = '-';
	document.getElementById("nsuid").innerHTML = '-';
	document.getElementById("genretags").innerHTML ='-';
	document.getElementById("ratingtags").innerHTML = '-';
	document.getElementById("worldreleasedate").innerHTML ='-';
	document.getElementById("numberOfPlayers").innerHTML = '-';
	document.getElementById("AgeRatings").innerHTML = '-';
	document.getElementById("InstalledSize").innerHTML = '-';
	document.getElementById("buildid8").innerHTML = '-';
	document.getElementById("buildid").innerHTML = '-';
	document.getElementById("titlekey").innerHTML = '-';
	document.getElementById("patchable").innerHTML = '-';
	document.getElementById("regions").innerHTML = '-';
	document.getElementById("introduction").innerHTML ='';
	document.getElementById("description").innerHTML = '';
	document.getElementById("htmlmanual").innerHTML = '-';
	document.getElementById("linkedacc").innerHTML ='-';
	document.getElementById("multicontent").innerHTML ='-';
	document.getElementById("distributiontype").innerHTML ='-';
	document.getElementById("gamemodes").innerHTML = '-';
	document.getElementById("productcode").innerHTML = '-';
	document.getElementById("metascore").innerHTML = '-';
	document.getElementById("userscore").innerHTML = '-';
	document.getElementById("openscore").innerHTML = '-';
	document.getElementById("developer").innerHTML = '-';
	document.getElementById("onlineplay").innerHTML = '-';
	document.getElementById("savedatacloud").innerHTML = '-';
	document.getElementById("firm").innerHTML = '-';
	document.getElementById("GamecardSize").innerHTML = '-';
	document.getElementById("titlekey_holder").style.visibility = 'visible';
	document.getElementById("titlekey_holder").style.display = "list-item";

	document.getElementById("metascore_holder").style.display = "block";
	document.getElementById("userscore_holder").style.display = "block";
	document.getElementById("openscore_holder").style.display = "block";

	document.getElementById("GamecardSize_holder").style.visibility = 'hidden';
	document.getElementById("GamecardSize_holder").style.display = "none";
	document.getElementById("rgv_holder").style.visibility = 'hidden';
	document.getElementById("rgv_holder").style.display = "none";
	document.getElementById("firm_holder").style.visibility = 'hidden';
	document.getElementById("firm_holder").style.display = "none";
	document.getElementById("_desc_bar_but").setAttribute("class", "disabled");
	document.getElementById("_desc_bar_but1").setAttribute("class", "mif-leanpub fg-steel");
	document.getElementById("_desc_bar_but2").setAttribute("class", "caption fg-steel");
	document.getElementById("_pict_bar_but").setAttribute("class", "disabled");
	document.getElementById("_pict_bar_but1").setAttribute("class", "mif-images fg-steel");
	document.getElementById("_pict_bar_but2").setAttribute("class", "caption fg-steel");
	document.getElementById("_video_bar_but").setAttribute("class", "disabled");
	document.getElementById("_video_bar_but1").setAttribute("class", "mif-video-camera fg-steel");
	document.getElementById("_video_bar_but2").setAttribute("class", "caption fg-steel");
	document.getElementById("_gtree_bar_but").setAttribute("class", "disabled");
	document.getElementById("_gtree_bar_but1").setAttribute("class", "mif-tree fg-steel");
	document.getElementById("_gtree_bar_but2").setAttribute("class", "caption fg-steel");
	document.getElementById("_cheats_bar_but").setAttribute("class", "disabled");
	document.getElementById("_cheats_bar_but1").setAttribute("class", "mif-bug fg-steel");
	document.getElementById("_cheats_bar_but2").setAttribute("class", "caption fg-steel");

	document.getElementById("ctag_overlay").style.visibility = 'hidden';
    var dataToHide = document.getElementsByClassName("exefsdata");
    for(var i = 0; i < dataToHide.length; i++){
        dataToHide[i].style.visibility = "visible";}
	document.getElementById("_filedata_").innerHTML = '';
	document.getElementById("_nacpdata_").innerHTML = '';
	document.getElementById("_npdmdata_").innerHTML = '';
	document.getElementById("_cnmtdata_").innerHTML = '';
	document.getElementById("_verificationdata_").innerHTML = '';
	document.getElementById("gametree").innerHTML = '';
	document.getElementById("cheat_data").innerHTML = '';
}
function show_gameinfo(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
document.getElementById("_inf_bar_but").click();
window.scrollTo(0,0);
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_Video_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_GameInfo_").style.display = "block";
document.getElementById("_imagebox_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}
function show_description(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_Video_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_Description_").style.display = "block";
document.getElementById("_imagebox_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}
function show_pictures(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_imagebox_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_Pictures_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}

function show_video(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_imagebox_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_Video_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}

function show_gametree(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_Video_").style.display = "none";
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_Gametree_").style.display = "block";
document.getElementById("_imagebox_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}

function show_cheats(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_Video_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("_Debug_").style.display = "none";
document.getElementById("load_button").style.display = "block";
document.getElementById("_Cheats_").style.display = "block";
document.getElementById("_imagebox_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}

function show_debug(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
document.getElementById("info_tab").click();
window.scrollTo(0,0);
document.getElementById("_GameInfo_").style.display = "none";
document.getElementById("_Pictures_").style.display = "none";
document.getElementById("_Video_").style.display = "none";
document.getElementById("_Gametree_").style.display = "none";
document.getElementById("_Description_").style.display = "none";
document.getElementById("_Files_").style.display = "none";
document.getElementById("_Nacp_").style.display = "none";
document.getElementById("_Npdm_").style.display = "none";
document.getElementById("_Cnmt_").style.display = "none";
document.getElementById("_Verification_").style.display = "none";
document.getElementById("_LocalLibrary_").style.display = "none";
document.getElementById("_RemoteLibrary_").style.display = "none";
document.getElementById("load_button").style.display = "none";
document.getElementById("_Cheats_").style.display = "none";
document.getElementById("_imagebox_").style.display = "none";
document.getElementById("_Debug_").style.display = "block";
document.getElementById("_viewspace_").style.height = "80vh";
}

<!-- ############################## -->

function get_local_libraries(){
	eel.get_libraries()(set_local_libraries)
	show_local_libraries()
	var selected = document.getElementById("_local_lib_select_").value
	set_local_lib_cache(selected)
}

function set_local_libraries(data){
	<!-- console.log(data) -->
	document.getElementById("_local_lib_tags_").innerHTML = data;
}

function show_local_libraries() {
	if (navclicks>0){
	document.getElementById("nav_view_but").click();
	}
	document.getElementById("info_tab").click();
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("load_button").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}

async  function search_local_lib(value){
	<!-- console.log(value) -->
	document.getElementById("_search_results_").style.display = "none";
	document.getElementById("local_activity").style.visibility = "visible";
	document.getElementById("local_activity").style.display = "block";
	var selected = document.getElementById("_local_lib_select_").value
	<!-- console.log(selected) -->
	await eel.call_search_local_lib(value,selected)
}

function set_local_lib_cache(name) {
	var lib='_cache_/_locallib_/'+name
    var xhr = new XMLHttpRequest();
    xhr.onload = function () {
		if (this.status!=404){
			load_local_results(this.responseText);
		};
    };
    xhr.open('GET', lib);
    xhr.send();
}

eel.expose(load_local_results)
function load_local_results(data){
	<!-- console.log(data) -->
	document.getElementById("local_activity").style.display = "none";
	document.getElementById("local_activity").style.visibility = "hidden";
	document.getElementById("_search_results_").style.display = "block";
	document.getElementById("_search_results_").innerHTML = data;
	document.getElementById('slocalbox').value='';
}

<!-- ############################## -->

function get_remote_libraries(){
	eel.get_drive_libraries()(set_remote_libraries)
	show_remote_libraries()
	var selected = document.getElementById("_remote_lib_select_").value
	set_remote_lib_cache(selected)
}

function set_remote_libraries(data){
	<!-- console.log(data) -->
	document.getElementById("_remote_lib_tags_").innerHTML = data;
}

function show_remote_libraries() {
	if (navclicks>0){
	document.getElementById("nav_view_but").click();
	}
	document.getElementById("info_tab").click();
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}

async function search_remote_lib(value){
	<!-- console.log(value) -->
	document.getElementById("_search_results2_").style.display = "none";
	document.getElementById("remote_activity").style.visibility = "visible";
	document.getElementById("remote_activity").style.display = "block";
	var selected = document.getElementById("_remote_lib_select_").value
	<!-- console.log(selected) -->
	eel.call_search_remote_lib(value,selected)
}

function set_remote_lib_cache(name) {
	var lib='_cache_/_remotelib_/'+name
    var xhr = new XMLHttpRequest();
    xhr.onload = function () {
		if (this.status!=404){
			load_remote_results(this.responseText);
		};
    };
    xhr.open('GET', lib);
    xhr.send();
}

eel.expose(load_remote_results)
function load_remote_results(data){
	<!-- console.log(data) -->
	document.getElementById("remote_activity").style.display = "none";
	document.getElementById("remote_activity").style.visibility = "hidden";
	document.getElementById("_search_results2_").style.display = "block";
	document.getElementById("_search_results2_").innerHTML = data;
	document.getElementById('remotebox').value='';
}

function show_filedata(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
	<!-- document.getElementById("_inf_bar_but").click(); -->
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "block";
	document.getElementById("_Files_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}
function show_nacpdata(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
	<!-- document.getElementById("_inf_bar_but").click(); -->
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "block";
	document.getElementById("_Nacp_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}
function show_npdmdata(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
	<!-- document.getElementById("_inf_bar_but").click(); -->
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "block";
	document.getElementById("_Npdm_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}
function show_cnmtdata(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
	<!-- document.getElementById("_inf_bar_but").click(); -->
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Verification_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "block";
	document.getElementById("_Cnmt_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}
function show_verdata(){
if (navclicks>0){
document.getElementById("nav_view_but").click();
}
	<!-- document.getElementById("_inf_bar_but").click(); -->
	window.scrollTo(0,0);
	document.getElementById("_GameInfo_").style.display = "none";
	document.getElementById("_imagebox_").style.display = "none";
	document.getElementById("_Description_").style.display = "none";
	document.getElementById("_Gametree_").style.display = "none";
	document.getElementById("_Cheats_").style.display = "none";
	document.getElementById("_LocalLibrary_").style.display = "none";
	document.getElementById("_RemoteLibrary_").style.display = "none";
	document.getElementById("_Pictures_").style.display = "none";
	document.getElementById("_Video_").style.display = "none";
	document.getElementById("_Files_").style.display = "none";
	document.getElementById("_Nacp_").style.display = "none";
	document.getElementById("_Npdm_").style.display = "none";
	document.getElementById("_Cnmt_").style.display = "none";
	document.getElementById("_Debug_").style.display = "none";
	document.getElementById("load_button").style.display = "block";
	document.getElementById("_Verification_").style.display = "block";
	document.getElementById("_viewspace_").style.height = "80vh";
}
function setmainimage(route){
document.getElementById("mainpicture").src = route
}

function showimg(){
	img=document.getElementById("mainpicture").src
	screen="height="+H+",width="+W+""
	window.open(img, "Window Title", screen);
}

function zoommainimage(){
MediumLightbox('figure.zoom-effect');
}

function search_table(inputid,searchid){
	var input, filter, table, tr, td, i, txtValue;
	input = document.getElementById(inputid);
	filter = input.value.toUpperCase();
	table = document.getElementById(searchid);
	tr = table.getElementsByTagName("li");
	  for (i = 0; i < tr.length; i++) {
		td = tr[i].getElementsByTagName("strong")[0];
		<!-- console.log(td) -->
		if (td) {
		  txtValue = td.innerHTML;
		  if (txtValue.toUpperCase().indexOf(filter) > -1) {
			tr[i].style.display = "";
		  } else {
			tr[i].style.display = "none";
		  }
		}
	  }
}
</script>
</body>
</html>
